<div class="main-content">
	<div class="breadcrumbs" id="breadcrumbs">
		<script type="text/javascript">
			try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
		</script>

		<ul class="breadcrumb">
			<li>
				<i class="icon-home home-icon"></i>
				<a href="#">系统首页</a>
			</li>
			<li class="active">
				加油站管理
			</li>
            <li class="active">
				加油站列表
			</li>
			<li class="active">
				油号管理
			</li>
			<li class="active">
				油枪管理
			</li>
		</ul><!-- .breadcrumb -->
	</div>
	<!-- Main content -->
    <div class="page-content">
    	<div class="row">
    	    <div class="page-header">
    			<h1>油枪列表信息</h1>
    		</div>
    		<div class="col-xs-12">
            	<a class="btn btn-info btn-sm" href="<?php echo base_url()."admin/oilgun/add_oilgun/".$gm_id."/".$gasstation_id?>"><i class="icon-copy"></i>新增</a>
                <a href="javascript:void(0)" onclick="delSomeModal()" data-toggle="modal" class="btn btn-danger btn-sm"><i class="icon-trash"></i>删除</a>
            	<a class="btn btn-info btn-sm" href="<?php echo base_url()."admin/gasolinemodel/index/".$gasstation_id?>"><i class="icon-copy"></i>返回</a>
            </div>
            <div class=" col-md-12 col-sm-12 col-xs-12 form">
                <div class="row">
                <form action="<?php echo base_url().'admin/oilgun/index/'.$gasstation_id.'/'.$gm_id?>" method="get">
                   <div class="wh">
                    	<label>油枪名称：</label>
                        <input type="text"  name="oilgun_name" value="<?php if (isset($oilgun_name))echo $oilgun_name;?>"/>
                   </div>
                    <div class="wh">
						<button class="btn btn-sm btn-info" type="submit"><i class="icon-search"></i>查询</button>
                    </div>
                </form>
                </div>
			</div>
			<div class="col-xs-12 margin_t margin_b">
				<div class="table-responsive  tab">
				<form action="<?php echo base_url()."admin/oilgun/del_some_oilgun/".$gm_id."/".$gasstation_id?>" method="post" id="delForm">
					<table id="sample-table-1" class="table table-striped table-bordered table-hover">
						<thead>
							<tr>
								<th class="center" style="width: 3%;">
									<label>
										<input type="checkbox" class="ace" />
										<span class="lbl"></span>
									</label>
								</th>
								<th>序号</th>
								<th>油枪名称</th>
                                <th>创建时间</th>
                                <th>二维码</th>
                                <th style="width: 25%;">操作</th>
							</tr>
						</thead> 
						<tbody>
						<?php if (isset($result)&&count($result)>0){
                            	foreach ($result as $oilgun){
                            	    if ($oilgun->del_flg==0){
                            	?>
							<tr>
								<td class="center">
                                	<p>
									<label>
										<input type="checkbox" class="ace" name="num[]" value="<?php echo $oilgun->id;?>"/>
										<span class="lbl"></span>
									</label>
                                    </p>
								</td>
								<td><p><?php echo $oilgun->id;?></p></td>
								<td><p><?php echo $oilgun->oilgun_name;?></p></td>
								<td><p><?php echo $oilgun->create_time;?></p></td>
								<td><p>
								<?php if ($oilgun->qrcode_url != ''){?>
								<a href="<?php echo base_url().'admin/oilgun/download_img/'.$gasstation_id.'/'.$gm_id.'/'.$oilgun->id;?>">
                                	<img src="<?php echo base_url().$oilgun->qrcode_url;?>" style="border-radius: 0%;width: 100px;">
                                </a>
                                <?php }else {?>
                    				暂无二维码
                    			<?php }?>
								</p></td>
								<td><p>                              
								    <a class="btn btn-sm btn-info" href="<?php echo base_url().'admin/oilgun/edit_oilgun/'.$gasstation_id.'/'.$gm_id.'/'.$oilgun->id;?>"><i class="icon-edit"></i>编辑</a>
                                    <a href="javascript:void(0)" onclick="delmodal('<?php echo $oilgun->id;?>','<?php echo $gm_id;?>','<?php echo $gasstation_id;?>')" data-toggle="modal" class="btn btn-danger btn-sm"><i class="icon-trash"></i>删除</a>
                                	<a href="<?php echo base_url().'admin/oilgun/qrcode_oilgun/'.$gasstation_id.'/'.$gm_id.'/'.$oilgun->id;?>" class="btn btn-sm btn-info"><i class="icon-edit"></i>生成二维码</a>
                                    </p>
                                </td>
                                </tr>
    						<?php }}
                            }else{?>
                            <tr>
                            	<td colspan="12">无数据</td>
                            </tr>
                            <?php }?>
                            </tbody>
                         </table>
                     </form>
                     </div><!-- /.table-responsive -->
            	</div>
            	<div class="col-sm-12">
                	<div class="modal-footer no-margin-top">
	                	<div class="pull-left record">
							共<?php echo $count;?>条记录
	                    </div>
                		<?php if (isset($page))echo $page;?>
                	</div>
                </div>
            </div><!-- /.row -->
		</div><!-- /.page-content -->
	</div><!-- /.main-content -->
	<div id="delModal" class="modal fade" role="dialog" aria-hidden="true">
		<div class="modal-dialog" style="width: 300px">
			<div class="modal-content">
				<div class="modal-header">
				  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				  <h3>提示信息</h3>
				</div>
				<div class="modal-body">
				  <p>确定要删除该油枪吗？</p>
				</div>
				<div class="modal-footer">
				  <a id="delbtn" href="#" class="btn btn-danger">确定</a>
				  <a href="#" class="btn btn-info" data-dismiss="modal" aria-hidden="true">取消</a>
				</div>
			</div>
		</div>
	</div>
	<div id="releaseModal" class="modal fade" role="dialog" aria-hidden="true">
		<div class="modal-dialog" style="width: 300px">
			<div class="modal-content">
				<div class="modal-header">
				  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				  <h3>提示信息</h3>
				</div>
				<div class="modal-body">
				  <p>确定发布该钉铛卷吗？</p>
				</div>
				<div class="modal-footer">
				  <a id="releasebtn" href="#" class="btn btn-danger">确定</a>
				  <a href="#" class="btn btn-info" data-dismiss="modal" aria-hidden="true">取消</a>
				</div>
			</div>
		</div>
	</div>
	
	<div id="delsomeModal" class="modal fade" role="dialog" aria-hidden="true">
		<div class="modal-dialog" style="width: 300px">
			<div class="modal-content">
				<div class="modal-header">
				  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				  <h3>提示信息</h3>
				</div>
				<div class="modal-body">
				  <p>确定要删除所选油枪吗？</p>
				</div>
				<div class="modal-footer">
				  <button id="delsomebtn" type="submit" class="btn btn-danger">确定</button>
				  <a href="#" class="btn btn-info" data-dismiss="modal" aria-hidden="true">取消</a>
				</div>
			</div>
		</div>
	</div>
	
	<script type="text/javascript">
	function delmodal(id,gm_id,gass_id){
		$("#delbtn").attr('href','<?php echo base_url().'admin/oilgun/del_oilgun/'?>'+id+'/'+gm_id+'/'+gass_id);
	    $('#delModal').modal('show');
	}
	function release(id){
		$("#releasebtn").attr('href','<?php echo base_url().'admin/activity/release/'?>'+id);
	    $('#releaseModal').modal('show');
	}
	function delSomeModal(){
		if(checkSelect()){
	    	$('#delsomeModal').modal('show');
		}else{
			alert('请选择正确的记录进行删除');
		}
	}
	$("#delsomebtn").click(function(){
		$("#delForm").submit();
    });

	</script>